package com.hrt.web.orderInfor.dao.impl;


import org.springframework.stereotype.Repository;

import com.hrt.base.BaseDaoImpl;
import com.hrt.bean.OrderInfor;
import com.hrt.web.orderInfor.dao.WebOrderDao;
@Repository
public class WebOrderDaoImpl extends BaseDaoImpl<OrderInfor> implements WebOrderDao{
	/**
	 * 根据memberId获取订单
	 * @return
	 */
	@Override
	public Long getOrderInforByMemberId(Long memberId,Integer status) {
		String hql=null;
		if(status==-1){
			
			hql = "select order from OrderInfor order where order.memberId='"+memberId+"' and order.isdelete=0 and order.isView=0";
		}
		else{
			hql = "select order from OrderInfor order where order.memberId='"+memberId+"' and order.isdelete=0 and order.isView=0 and order.status='"+status+"'";
		}
		return (long) getHibernateTemplate().find(hql).size();
	}

}
